using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;

namespace 畜牧业审核程序国产;

public partial class MyProgressBar : Window
{
    public MyProgressBar()
    {
        InitializeComponent();
    }
    public void UpdateProgress(int value)
    {
        // 在UI线程上更新进度条
        Dispatcher.UIThread.InvokeAsync(() =>
        {
            myProgressText.Text = $"进度:{value}%";
            myProgressBarControl.Value = value;
        });
    }
}